#include "main.h"

void delay(uint16_t x) {
    uint16_t i =0 ;
    for(i=0;i<x;i++){
        ;
    }
}


// #define TIMER_RS 

void main() {
    P0 = 0;
    uint32_t TIMER_RS = 12000000/2;

    int16_t a = 0 ;
    int16_t b = 0 ;
    int16_t c = 1 ;
    uint16_t i = 0 ; 

    // 设置定时器0 
    PXY_WR(TIMER_BASE + 0,(TIMER_RS>>16)&0xff );
    PXY_WR(TIMER_BASE + 1,(TIMER_RS>>8)&0xff);
    PXY_WR(TIMER_BASE + 2,TIMER_RS&0xff); 
    // 使能定时器0
    PXY_WR(TIMER_BASE + 3,0x01);

    // IE = 0X80 ; //开启全局中断 
    while(1) {
        for(i=0;i<500;++i) {
            // a = a*b + a/c ; 
            // a++;
            // b++;
            // c++;
            // c = c % 10 + 1 ;

            a = a*b ; 
            a++;
            b++;
            c++;
        }
        P0 = ~P0;
    }
}